<?php
//$con = mysql_connect('182.18.165.252', 'root', '@cyberlinks');
$con = mysql_connect('localhost', 'root', '@cyberlinks');
if (!$con) {
    die('Could not connect: ' . mysql_error());
}
mysql_select_db("ttsl_urlredirectiongateway", $con);
define('ROOTURL','http://182.18.165.252/urlgateway_new/');

function permissionCheck()
{
	$user_id = $_SESSION['u_id'];
	$sql = "Select * FROM user_rights_ref where user_id=$user_id";
	$query = mysql_query($sql);
	//echo "<pre>";
	//print_r($_SESSION['rights']);
	//$_SESSION[];
	
	$rights=array();
	for($i=1; $i<7;$i++)
	{
	  $rights[] = @$_SESSION['rights_'].$i;
	}
	return $rights;
}
// print_r($rights);
 
// $sql1 = "Select * FROM rights";
 //$query1 = mysql_query($sql1);
 
 
 function hitcount($shorturl_id)
	 {
	 	 $sql = "Select * from track_url where shorturl_id=$shorturl_id";
		 $query = mysql_query($sql);
		 $count = mysql_num_rows($query);
	 	return $count;
	 }
 
?>